import request from "@/utils/request";

/**
 * 获取设备列表
 * @param params
 * @returns {*}
 */
export function getDeviceList(params) {
  return request({
    url: "/zk/device/list",
    method: "get",
    params: params,
  });
}

/**
 * 获取设备列表
 * @param params
 * @returns {*}
 */
export function getDeviceListFold(params) {
  return request({
    url: "/zk/device/listFold",
    method: "get",
    params: params,
  });
}
export function getDeviceByNotAuth(params) {
  return request({
    url: "/zk/device/getDeviceByNotAuth",
    method: "get",
    params: params,
  });
}

/**
 * @Auther: 唐十七
 * @Date: 2024/11/19 20:35
 * @Description: 新增设备
 * @Params: * @param null
 * @Returns:
 */
export function addDevice(data) {
  return request({
    url: "/zk/device",
    method: "post",
    data: data,
  });
}

/**
 * @Auther: 唐十七
 * @Date: 2024/11/19 20:37
 * @Description: 根据num获取设备
 * @Params: * @param null
 * @Returns:
 */
export function getByNum(num) {
  return request({
    url: "/zk/device/" + num,
    method: "get",
  });
}

/**
 * @Auther: 唐十七
 * @Date: 2024/11/19 20:37
 * @Description: 修改设备
 * @Params: * @param null
 * @Returns:
 */
export function editDevice(data) {
  return request({
    url: "/zk/device",
    method: "put",
    data: data,
  });
}

/**
 * @Auther: 唐十七
 * @Date: 2024/11/19 20:38
 * @Description: 删除设备
 * @Params: * @param null
 * @Returns:
 */

export function removeBatch(nums) {
  return request({
    url: "/zk/device/" + nums,
    method: "delete",
  });
}

export function getDeviceSortList() {
  return request({
    url: "/zk/device/getSortList",
    method: "get",
  })
}
